<?php defined('SYSPATH') or die('No direct script access.');
$mydatetime      = Helper_mydatetime::factory();
$arraylist      = Helper_arraylist::factory();
$display         = Helper_displayitems::factory();
?>

<?php $arrays = $arraylist->print_array($table,$id) ?>
<?php $child_arrays = $arraylist->print_array_child('surat_penerimaan_brg_masuk_t',$id) ?>	

<div style="max-width: 1000px; border: 1px solid black; padding: 10px; height: 180px;">
	<div style="text-align: center; font-weight: bold;">SURAT PENERIMAAN BARANG MASUK</div>
	Detail Penerimaan Barang Masuk :<br><br>
	<table>
		<tr>
			<td>ID Penerimaan Barang Masuk</td>
			<td>:</td>
			<td><?php echo $arrays[0]['id'] ?></td>
		</tr>
		<tr>
			<td>Tgl</td>
			<td>:</td>
			<td><?php echo $mydatetime->mktime_from_sql($arrays[0]['tgl']) ?></td>
		</tr>
		<tr>
			<td>ID Purchase Order</td>
			<td>:</td>
			<td><?php echo $arrays[0]['id_purchase_order'] ?></td>
		</tr>
		
	</table>

	<table border="1" width="100%" cellpading="0" cellspacing="0">
		<tr>
			<td style="text-align: center; font-weight: bold;" width="">Nama Sukucadang</td>
			<td style="text-align: center; font-weight: bold;" width="200">Merek SC</td>
			<td style="text-align: center; font-weight: bold;" width="200">Jenis SC</td>
			<td style="text-align: center; font-weight: bold;" width="200">Tipe SC</td>
			<td style="text-align: center; font-weight: bold;" width="100">Jumlah SC</td>
		</tr>
		<?php if(!empty($child_arrays)) { ?>
		<?php foreach($child_arrays as $child_array) { ?>
		<tr>
			<td><?php echo $display->show_value($child_array['id_sukucadang'],'master_sukucadang') ?></td>
			<td><?php echo $display->show_value($display->show_value($child_array['id_sukucadang'],'master_sukucadang','merek_sukucadang'),'merek_sukucadang') ?></td>
			<td><?php echo $display->show_value($display->show_value($child_array['id_sukucadang'],'master_sukucadang','jenis_sukucadang'),'jenis_sukucadang') ?></td>
			<td><?php echo $display->show_value($display->show_value($child_array['id_sukucadang'],'master_sukucadang','tipe_sukucadang'),'tipe_sukucadang') ?></td>
			<td><?php echo $child_array['jumlah'] ?></td>
		</tr>
		<?php } ?>
		<?php } ?>
	</table>
</div>























